<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<script type="text/javascript" src="data.js">

		</script>
		<title></title>
		<script type="text/javascript">
			document.addEventListener('plusready', function() {
				plus.webview.create('backgroud.html', 'b').show()
				for (var item in _create) {
					let w = plus.webview.create(_create[item], _create[item], {
						top: plus.navigator.getStatusbarHeight(),
						bottom: '0px',
						render: 'always'
					})
					w.appendJsFile('_www/data.js');
					w.appendJsFile('_www/js/index.js');
					w.setCssFile('_www/css/index.css');
				}
				plus.webview.show(_create['index'], "slide-in-right")
				var first = null;
				plus.key.addEventListener("backbutton", function() {
					wvs = plus.webview.getDisplayWebview()
					for (var item in _create) {
						if (_create[item] == wvs[1].id) {
							if (!first) {
								first = new Date().getTime();
								plus.ui.toast("再按一次退出应用");
								setTimeout(function() {
									first = null;
								}, 2000);
							} else {
								if (new Date().getTime() - first < 2000) {
									plus.runtime.quit();
								}
							}

							return false;
						}
					}
					plus.webview.close(wvs[1], "slide-out-right")

				});

			});
		</script>
	</head>

	<body style="height: 44px;">

	</body>

</html>
